package com.ewhome.apartment.app.service;

import android.content.Context;
import android.text.TextUtils;

import com.baidu.android.pushservice.PushMessageReceiver;
import com.ewhome.apartment.app.EventBusTags;
import com.ewhome.apartment.app.constant.AppConstant;
import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.DataHelper;

import org.simple.eventbus.EventBus;

import java.util.List;

import timber.log.Timber;

/**
 * author:zhangjing
 * 作用:
 * return:
 */

public class BaiduPushMessageReceiver extends PushMessageReceiver{
    @Override
    public void onBind(Context context, int i, String s, String s1, String s2, String s3) {
        EventBus.getDefault().post(s2,EventBusTags.CHANNEL_ID_SUCCESS);
        if (i==0){
            Timber.tag("推送").w(s2);
            if (TextUtils.isEmpty(DataHelper.getStringSF(context, AppConstant.BAIDU_PUSH_CHANELID))){
                DataHelper.setStringSF(context,AppConstant.BAIDU_PUSH_CHANELID,s2);
            }
        }
    }

    @Override
    public void onUnbind(Context context, int i, String s) {

    }

    @Override
    public void onSetTags(Context context, int i, List<String> list, List<String> list1, String s) {

    }

    @Override
    public void onDelTags(Context context, int i, List<String> list, List<String> list1, String s) {

    }

    @Override
    public void onListTags(Context context, int i, List<String> list, String s) {

    }

    @Override
    public void onMessage(Context context, String s, String s1) {

    }

    @Override
    public void onNotificationClicked(Context context, String s, String s1, String s2) {

    }

    @Override
    public void onNotificationArrived(Context context, String s, String s1, String s2) {

    }
}
